LIST_FLAGS_USER = 1 << 0,
LIST_FLAGS_SYSTEM = 1 << 1,
LIST_FLAGS_ENABLED = 1 << 2,
- LIST_FLAGS_DISABLED = 1 << 3
+ LIST_FLAGS_DISABLED = 1 << 3,
+ LIST_FLAGS_NO_PREFS = 1 << 4
} ListFilterFlags;
static gboolean
{
g_autoptr (GVariantDict) info = NULL;
double type, state;
+ gboolean has_prefs;
info = g_variant_dict_new (value);
g_variant_dict_lookup (info, "type", "d", &type);
g_variant_dict_lookup (info, "state", "d", &state);
+ g_variant_dict_lookup (info, "hasPrefs", "b", &has_prefs);
if (type == TYPE_USER && (filter & LIST_FLAGS_USER) == 0)
continue;
if (state != STATE_ENABLED && (filter & LIST_FLAGS_DISABLED) == 0)
continue;
+ if (!has_prefs && (filter & LIST_FLAGS_NO_PREFS) == 0)
+ continue;
+
if (needs_newline)
g_print ("\n");
gboolean system = FALSE;
gboolean enabled = FALSE;
gboolean disabled = FALSE;
+ gboolean has_prefs = FALSE;
GOptionEntry entries[] = {
{ .long_name = "user",
.arg = G_OPTION_ARG_NONE, .arg_data = &user,
{ .long_name = "disabled",
.arg = G_OPTION_ARG_NONE, .arg_data = &disabled,
.description = _("Show disabled extensions") },
+ { .long_name = "prefs",
+ .arg = G_OPTION_ARG_NONE, .arg_data = &has_prefs,
+ .description = _("Show extensions with preferences") },
{ .long_name = "details", .short_name = 'd',
.arg = G_OPTION_ARG_NONE, .arg_data = &details,
.description = _("Print extension details") },
if (disabled || !enabled)
flags |= LIST_FLAGS_DISABLED;
+ if (!has_prefs)
+ flags |= LIST_FLAGS_NO_PREFS;
+
return list_extensions (flags, details ? DISPLAY_DETAILED
: DISPLAY_ONELINE) ? 0 : 2;
}